#ifndef _SCENARIO_H_
#define _SCENARIO_H_

#include "grid.h"
#include "job.h"
#include "adaptivepartitioner.h"

class Scenario {
	private:
		/*Scenario name*/
		const char *name;
		/*The Grid*/
		Grid *grid;
		/*The application*/
		Job *job;
		/*The Job partioner*/
		AdaptivePartitioner *adaptivePartioner;
		/*The number of executions of the scenario*/
		int numberOfExecutions;
		/*The seed used to feed the random number generator*/
		long double seed;
		
		long double error_rate;

		long double jobInputSize;

		long double averageTaskInputSize;
		long double inputHeterogeneity;

		long double averageTaskOutputSize;
		long double outputHeterogeneity;		

		long double gridSpeed;
		long double gridHeterogeneity;
		
		
	public:
		Scenario(const char *name, Job *job, Grid *grid, int numberOfExecutions=1, long double seed=0.1, long double error_rate=0);
		~Scenario();

		/*Get the name of this scenario*/
		const char *getName();

		/*Set and get the grid*/
		void setGrid(Grid *newGrid);
		Grid *getGrid();

		/*Set and get the job*/
		void setJob(Job *newJob);
		Job *getJob();

		/*Get and set how many times this scenario must be executed*/
		void setNumberOfExecutions (int executions);
		int getNumberOfExecutions();

		/*Get and set the seed*/
		void setSeed(long double seed);
		long double getSeed();
		
		void setJobInputSize(long double jobInputSize);	
		long double getJobInputSize();
		
		void setAverageTaskInputSize(long double size);
		long double getAverageTaskInputSize();

		void setInputHeterogeneity(long double het);
		long double getInputHeterogeneity();

		void setAverageTaskOutputSize(long double size);
		long double getAverageTaskOutputSize();

		void setOutputHeterogeneity(long double het);
		long double getOutputHeterogeneity();		

		void setGridSpeed(long double speed);
		long double getGridSpeed();

		void setGridHeterogeneity(long double het);		
		long double getGridHeterogeneity();
		
		void setAdaptivePartioner(AdaptivePartitioner *partioner);
		AdaptivePartitioner* getAdaptivePartioner();
		
		void setErrorRate(long double error_rate);
		long double getErrorRate();
		
		/*Writes the scenario to a XML file*/
		void writeToXML(const char *scenario_desc);
		
};

#endif //_SCENARIO_H_
